<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>${_front_title}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/static/favicon.ico"/>
    <link rel="stylesheet" href="/static/front/fonts/iconfont.css">
    <link rel="stylesheet" href="/static/front/css/base_new.css">
    <link rel="stylesheet" href="/static/front/css/library.css">
    <link rel="stylesheet" href="/static/front/css/style.css">
    <script src="/static/front/js/jquery-1.11.1.min.js"></script>
    <script src="/static/front/js/jquery.countdown.js"></script>
    <script src="/static/front/js/js.js"></script>
    <!--[if lt IE 9]>
    <script src="/static/front/js/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script type="text/javascript" src="plugIn/PIE.js"></script>
    <![endif]-->
     <style type="text/css">
       .investment .quick_screen{display:inline;}
       .investment .quick_screen:after{display:block;content:'';overflow:hidden;width:0;height:0;celar:both;}
       .investment .quick_screen span{margin-top:8px;margin-left:25px;}
       .investment .screen ul li{float:left;margin:8px 5px;}
       .investment .screen ul li a{display:inline;padding:3px 10px;}
       .investment .screen ul li a.current{background:#6DBD45;color:#fff;}
       .investment .screen ul li a:hover{background:#6DBD45;color:#fff;}
       
       .Tab .Tab-shuaixuan{float:right;margin-top:-40px;cursor:pointer;width: 78px;height: 25px;border: #4db0c2 1px solid;background: #5dc0d2;color: #fff;border-radius: 3px;-webkit-border-radius: 3px;-moz-border-radius: 3px;
    	-ms-border-radius: 3px;text-align: center;behavior: url(plugIn/PIE.htc);line-height:25px;}
   		
   		.investment .quick_sxtj{margin-left:20px;}
   		.investment .quick_sxtj ul.clearfix li{font-size:12px;}
   		.investment .quick_sxtj ul.clearfix li input{border:1px solid #ccc;height:25px;}
   		.investment .quick_sxtj ul.clearfix li .quick_btn{width:50px;height:27px;border: #4db0c2 1px solid;background: #5dc0d2;color: #fff;border-radius: 3px;-webkit-border-radius: 3px;
   		-moz-border-radius: 3px;-ms-border-radius: 3px;text-align: center;behavior: url(plugIn/PIE.htc);line-height:26px;cursor:pointer;margin-left:20px;}
   		
   		.address_p{
		    width: 110px;
		    display: inline-block;
   		}
      </style>
      <script>
       window.onload=function(){
       		var h = $('.screen').height();
	     	if(h==0){
	     		$('.screen').css('border','none')
	     	};
	      	$('.Tab-shuaixuan').click(function(){
	      		var h = $('.screen').height();
	      		if(h==0){
	      			$('.screen').css({
	      				'borderTop':'1px dashed #ccc',
	      				borderLeft:'1px solid #e1e1e1',
	      				borderRight:'1px solid #e1e1e1'
	      			}).animate({
	      				height:90
	      			});
	      		}else{
	      			$('.screen').animate({
	      				height:0
	      			},function(){
	      				$('.screen').css('borderTop','none');
	      			});
	      		};
	      	});
       };
     	
      </script>
</head>

<body>
    <!-- 头部 开始 -->
    <div id="header">
		<#include "../base/top.ftl" />
	</div>
	<!-- 头部 结束 -->
    <div class="content">
    <div id="myInvestmentMain" class="cnt clearfix layoutMain">
       <#include "base1.ftl" />
        <div class="investment fr">
            <h2>我的积分</h2>
            <div class="Tab" style="margin-top: 48px;">
                <span data="record"  class="TabOne tableTab <#if temp?? && temp=="record">active</#if>">积分记录</span>
                <span data="convert" class="TabTwo tableTab <#if temp?? && temp=="convert">active</#if>">我的兑换</span>
                <span data="address" class="TabThree tableTab <#if temp?? && temp=="address">active</#if>">收获地址</span>
                <!--积分记录开始-->
                <table class="tabLibrary receivables" border="0" cellspacing="0" cellpadding="0" style='margin-top: 0px;<#if temp?? && temp=="record">display:block;<#else>display:none;</#if>'>
                    <tbody style="display:block;padding-top:0px;">
                    	<tr style='display:block;border-left:1px solid #dfdfdf;border-right:1px solid #dfdfdf;border-top:1px solid #dfdfdf;float:left;'>
                    		<td style='width:325px;border-right:1px solid #dfdfdf;line-height:0px;float:left;'>积分总数</td>
                    		<td style='width:325px;border-right:1px solid #dfdfdf;line-height:0px;float:left;'>可用积分</td>
                    		<td style='width:325px;line-height:0px;float:left;'>已用积分</td>
                    	</tr>
                    	<tr style='display:block;border-left:1px solid #dfdfdf;border-right:1px solid #dfdfdf;'>
		                	<td style='width:325px;border-right:1px solid #dfdfdf;line-height:0px;float:left;'><#if score?? && score.score?exists>${score.score}<#else>0</#if></td>
		                	<td style='width:325px;border-right:1px solid #dfdfdf;line-height:0px;float:left;'><#if score?? && score.score?exists>${score.score}<#else>0</#if></td>
		                	<td style='width:325px;line-height:0px;float:left;'><#if score?? && score.alreadyScore?exists>${score.alreadyScore}<#else>0</#if></td>
                    	</tr>
                    	<!--
                    	<tr style='dsiplay:block;'>
                    		<td style='text-align:left;font-weight:600;padding-top:30px;'></td>
                    	</tr>
                    	-->
	                    <tr class="clearfix">
	                        <th class="one"style="text-align:center;float:left;width:265px;">时间</th>
	                        <th class="two" style="text-align:center;float:left;width:260px;">类型</th>
	                        <th class="three" style="text-align:center;float:left;">积分数量</th>
	                        <th class="four" style="text-align:center;float:left;">途径</th>
	                        <th class="five" style="text-align:center;float:left;">备注</th>
	                    </tr>
               			<#if (pageInfo?? & pageInfo.pageList?size>0)>
                    		<#list pageInfo.pageList as model>
	                    		<tr class="clearfix">
			                        <td class="one clearfix" style='text-align:center;float:left;width:265px;'>
			                            <#if model.createTime?exists>${model.createTime?string("yyyy-MM-dd HH:mm:ss")}</#if>
			                        </td>
			                        <td class="two" style="float:left;width:260px;">
			                           <#if (model.optType?exists) & model.optType =="out">
	                        				支出
	                        			<#elseif (model.optType?exists) & model.optType =="in">
	                        				收入
	                        			</#if>
			                        </td>
			                        <td class="three"  style="float:left;">
				                        <#if model.amount?exists>${model.amount}</#if>
			                        </td>
			                        <td class="four"  style="float:left;">
			                        	<#if model.way?exists>${model.way}</#if>
		                        	</td>
			                        <td class="five" style="float:left;">
			                        	暂无
			                        </td>
			                    </tr>
	                    	</#list>
                    	<#else>
			                	<tr style='display:block;'><td rowspan="6" style="display: block;width:100%;height:30px;">暂无数据</td></tr>
              			</#if>
                	</tbody>
                </table>
                <!--积分记录结束-->
                <!--我的兑换开始-->
                <table class="tabLibrary receivables" border="0" cellspacing="0" cellpadding="0" style='margin-top: 0px;<#if temp?? && temp=="convert">display:block;<#else>display:none;</#if>'>
                    <tbody style="display:block;">
	                    <tr>
	                        <th class="two" style="text-align:center;float:left;width:228px;">兑换时间</th>
	                        <th class="three" style="text-align:center;float:left;">商品编号</th>
	                        <th class="four" style="text-align:center;float:left;">商品名称</th>
	                        <th class="five" style="text-align:center;float:left;">使用积分</th>
	                        <th class="five" style="text-align:center;float:left;">发货订单号</th>
	                        <th class="five" style="text-align:center;float:left;">操作</th>
	                    </tr>
               			<#if (buyPageInfo?? & buyPageInfo.pageList?size>0)>
                    		<#list buyPageInfo.pageList as model>
			                    <tr>
			                        <td class="one" style="text-align:center;float:left;width:226px;">
			                           <#if model.buyTime?exists>${model.buyTime?string("yyyy-MM-dd HH:mm:ss")}</#if>
			                        </td>
			                        <td class="two"  style="float:left;">
				                       <#if (model.goodId?exists)>${model.goodId}</#if>
			                        </td>
			                        <td class="three"  style="float:left;">
			                        	<#if model.goodName?exists>${model.goodName}</#if>
		                        	</td>
			                        <td class="four"  style="float:left;">
			                        	<#if model.score?exists>${model.score}</#if>
			                        </td>
			                        <td class="five"  style="float:left;">
			                        	<#if model.code?exists>
	                        				${model.code}
	                        			<#else>
	                        				暂未发货
	                        			</#if>
			                        </td>
			                        <td class="six" style="float:left;">
			                        	暂无
			                        </td>
			                    </tr>
	                    	</#list>
                    	<#else>
			                	<tr style='display:block;'><td rowspan="6" style="display: block;width:100%;height:30px;">暂无数据</td></tr>
              			</#if>
                	</tbody>
                </table>
                <!--我的兑换结束-->
                <!--收获地址开始-->
                <table class="tabLibrary receivables" border="0" cellspacing="0" cellpadding="0" style='margin-top: 0px;<#if temp?? && temp=="address">display:block;<#else>display:none;</#if>'>
                    <tbody style="display:block;padding-top:0px;">
	                    <tr style='border-right:1px solid #ccc;border-left:1px solid #ccc;'>
	                        <th class="three" style="text-align:center;width:328px;float:left;box-sizing:border-box;">收获地址</th>
	                        <th class="one" style="text-align:center;width:150px;float:left;box-sizing:border-box;">收获人姓名</th>
	                        <th class="two" style="text-align:center;width:150px;float:left;box-sizing:border-box;">联系方式</th>
	                        <th class="four" style="text-align:center;width:200px;float:left;box-sizing:border-box;">备注</th>
	                        <th class="five" style="text-align:center;width:150px;float:left;box-sizing:border-box;">操作</th>
	                    </tr>
               			<#if ((cnee?exists) & (cnee.pageList?size>0))>
                        	<#list cnee.pageList as model>
	                    		<tr style='border-right:1px solid #ccc;border-left:1px solid #ccc;'>
			                        <td class="one clearfix" style="text-align:center;float:left;width:328px;">
			                        	<#if (model.address?exists)>${model.address}</#if>
			                        </td>
			                        <td class="two"  style="float:left;width:150px;">
			                        	<#if model.name?exists>${model.name}</#if>
			                        </td>
			                        <td class="three" style="float:left;width:150px;">
				                        <#if model.phone?exists>${model.phone[0..2]}****${model.phone[7..10]}</#if>
			                        </td>
			                        <td class="four" style="float:left;width:200px;">
			                        	暂无
		                        	</td>
			                        <td class="five" style="float:left;width:150px;">
			                        	暂无
			                        </td>
			                    </tr>
	                    	</#list>
                    	<#else>
			                	<tr style='display:block;'><td style="display: block;width:100%;height:30px;">暂无数据</td></tr>
              			</#if>
                    	<tr style='display:block;border:1px solid #ccc;border-bottom:none;border-top:none;padding-top: 10px;'>
                    		<td colspan="5" style='border:none;padding:10px 0;text-align:left;padding-left:30px;'><p class="address_p">收货人：</p><input id="test1" type="text" style='width:150px;border:1px solid #ccc;padding:3px 5px;height: 26px;line-height: 26px;'/></td>
                    	</tr>
                    	<tr style='display:block;border-left:1px solid #ccc;border-right:1px solid #ccc;'>
                    		<td colspan="5" style='border:none;padding:10px 0;text-align:left;padding-left:30px;'><p class="address_p">详情地址：</p><input id="test2" type="text" style='border:1px solid #ccc;padding:3px 5px;width:400px;height: 26px;line-height: 26px;'/></td>
                    	</tr>
                    	<tr style='display:block;border-left:1px solid #ccc;border-right:1px solid #ccc;'>
                    		<td colspan="5" style='border:none;padding:10px 0;text-align:left;padding-left:30px;'><p class="address_p">手机号码：</p><input id="test3" type="text" style='width:150px;border:1px solid #ccc;padding:3px 5px;height: 26px;line-height: 26px;'/><span style='padding-left:20px;color:#6DBD45;'>用于接收发货通知短信 </span></td>
                    	</tr>
                    	<tr style='display:block;border-left:1px solid #ccc;border-right:1px solid #ccc;'>
                    		<td colspan="5" style='display:block;text-align:left;'>
                    			<button class="but button1" style='margin-top:-40px;margin-left:140px;cursor: pointer;width:160px;border: #4db0c2 1px solid;background: #5dc0d2;color: #fff;border-radius: 3px;-webkit-border-radius: 3px;-moz-border-radius: 3px;-ms-border-radius: 3px;text-align: center;line-height: 35px;'>保存</button>
                    		</td>
                    	</tr>
                	</tbody>
                </table>
                <!--收获地址结束-->
            </div>
            <!-- 分页组件 -->
           <#if (pageInfo??) & (pageInfo.pageList?size>0) || (buyPageInfo??) & (buyPageInfo.pageList?size>0) >
            	<div class="tcdPageCode"></div>
            </#if>
        </div>
    </div>
    <div id="footer">
      <div class="content">      
		<#include "../base/foot.ftl" />
      </div>
    </div>       
</div>
<script type="text/javascript" src="${_front_js}/jquery.page.js"></script>
<script type="text/javascript" src="${_front_js}/layer/layer.js" ></script>
<script type="text/javascript" src="${_front_js}/layer/extend/layer.ext.js" ></script>
<script>
$(".tcdPageCode").createPage({
    pageCount:<#if (pageInfo?? & pageInfo.pages?exists)>
    			${pageInfo.pages}
    		  <#elseif (buyPageInfo?? & buyPageInfo.pages?exists)>
    		  	${buyPageInfo.pages}
		  	  <#elseif (cnee?? & cnee.pages?exists)>
		  	  ${cnee.index}
			  </#if>,//总页数
    current:<#if (pageInfo?? & pageInfo.index?exists)>
    			${pageInfo.index}
    		  <#elseif (buyPageInfo?? & buyPageInfo.index?exists)>
    		  	${buyPageInfo.index}
		  	  <#elseif (cnee?? & cnee.index?exists)>
		  	  ${cnee.index}
			  </#if>,
    backFn:function(index){
    	 window.location.href="/account/score?temp=${temp}&index="+index;
    }
});
	$(".TabOne").click(function(){
		var temp = $(this).attr("data");
		window.location.href="/account/score?temp="+temp;
	})
	$(".TabTwo").click(function(){
		var temp = $(this).attr("data");
		window.location.href="/account/score?temp="+temp;
	})
	$(".TabThree").click(function(){
		var temp = $(this).attr("data");
		window.location.href="/account/score?temp="+temp;
	})

 //添加收货人信息
    $(".button1").click(function(){
    	var name = $("#test1").val();
		var address = $("#test2").val();
		var phone = $("#test3").val();
		if(name == null || name==""){
			layer.alert("请填写收货人姓名！");
			return false;
		}
		if(address == null || address==""){
			layer.alert("请填写收货人地址！");
			return false;
		}
		if(phone == null || phone==""){
			layer.alert("请填写收货人联系方式！");
			return false;
		}
		var reg = /^1\d{10}$/g;
		if(!reg.test(phone)){
			layer.alert("手机号码格式不正确，请重新输入");
			return false;
		}
		$.ajax({
			type : "POST",
			url : "/account/cnee",
			data : {
				"name" : name,
				"address" : address,
				"phone" : phone,
			},
			async : false,
			success : function(result) {
				if (result.code == -1) {
					layer.alert(result.msg, function(index){
				   		window.location.href="/account/score?temp=address";
			   		})
				}else{
					layer.alert(result.msg);
				}
			}
		})
    })
</script>
</body>

</html>
